﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/MasterPage/Admin.master" AutoEventWireup="true" CodeFile="Videos.aspx.cs" Inherits="Administrator_Videos" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        <h3>Quản lý Videos</h3>
        <asp:Repeater ID="rptVideos" runat="server" onitemcommand="rptVideos_ItemCommand">
            <HeaderTemplate>
                <table>
                    <tr>
                        <td>STT</td>
                        <td>Title</td>
                        <td>Link</td>
                        <td>Action</td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                    <tr>
                        <td><%# Container.ItemIndex+1 %></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "title")%></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "link")%></td>
                        <td>
                            <asp:ImageButton ID="btnedit" runat="server" style="width:15px; height:15px" ImageUrl="~/images/Admin/icon_edit.gif" CommandName="edit"
                             CommandArgument='<%#DataBinder.Eval(Container.DataItem, "title") %>' />&nbsp;
                            <asp:ImageButton ID="btndelete" runat="server" ImageUrl="~/images/Admin/icon_delete.gif.png" CommandName="delete" 
                            CommandArgument='<%#DataBinder.Eval(Container.DataItem, "title") %>' OnClientClick="return confirm('Bạn có chắc muốn xóa không ?');" />
                        </td>
                    </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <div>
            <asp:Panel ID="panelVideo" runat="server" Visible="false">
                <table>
                    <tr>
                        <td>Title</td>
                        <td><asp:TextBox ID="txtTitle" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>Link file</td>
                        <td>http:// <asp:TextBox ID="txtLinkfile" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblUpload" runat="server" Text="Upload file"></asp:Label></td>
                        <td><asp:FileUpload ID="file" runat="server" /></td>
                    </tr>
                    <tr>
                        <td colspan="2">( Chỉ chọn up link hoặc upload file. )</td>
                    </tr>
                    <tr>
                        <td colspan="2"><asp:Label ID="lblmsg" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="btnSubmit" runat="server" Text="Save" 
                                onclick="btnSubmit_Click" />
                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
    </div>
</asp:Content>

